A regular expression immediately followed by a question mark ( ? ) makes the expression optional. For example
A?
matches 0 or 1 occurrence of the letter 'A'.
See Also
Introducing Regular Expressions
Simple Expressions
Character Classes
Special Character Classes
Repeating Patterns
Alternatives
Grouping
Predefined Compound Expressions